<!DOCTYPE html>
<html>
<head>
  	<meta charset="utf-8">
  	<title>忘记密码 &lt; 测试 - Jwp</title>
  	<meta name="renderer" content="webkit">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  	<link rel="stylesheet" href="/assets/layui/css/layui.css" media="all">
  	<link rel="stylesheet" href="/assets/admin/css/admin.css" media="all">
</head>

<body class="login">

	<div id="login">
		<h1><a href="" title="Jwp" >Jwp</a></h1>
		<!-- <h2>by 佰亿互联</h2> -->
		
		<p class="message"> 请输入您的用户名或电子邮箱地址。您会收到一封包含创建新密码链接的电子邮件。</p>
		
		<!-- 
		<div id="login_error"> <strong>错误</strong>：error </div>
		<p class="success">	登录成功。</p> -->

		<form name="loginform" class="layui-form" id="loginform" action="/admin/forget" method="post">
			<p>
				<label for="user_login">用户名或电子邮件地址</label>
				<input type="text" name="username" id="user_login" class="layui-input" value="">
			</p>
			<p class="vcode">
				<label for="vcode">验证码</label>
				<input type="text" name="vcode" id="vcode" class="layui-input" value="">
			</p>
			<p class="captcha">
				<label for="captcha">刷新一下 <i class="layui-icon layui-icon-refresh"></i> </label>
				<img src="/admin/captcha" id="captcha" height="30px;"/>
			</p>
			<br class="layui-clear">
			<p class="submit">
				<input type="submit" lay-submit lay-filter="*" name="wp-submit" id="wp-submit" class="layui-btn layui-btn-sm" value="获取新密码">
			</p>
			<br class="layui-clear">
		</form>
		
		<p id="nav">
			<a href="/admin/login">登录</a>
			|
			<a href="/admin/register">注册</a>
		</p>

		<p id="backtoblog"><a href="/">← 返回到测试</a></p>
	</div>

  	<script src="/assets/layui/layui.js"></script>  
  	<script>
  	function wp_attempt_focus(){
		setTimeout( function(){ 
			try{
				d = document.getElementById('user_login');
				d.focus();
				d.select();
			} catch(e){}
		}, 200);
	}
	
	wp_attempt_focus();
	if(typeof wpOnload=='function')wpOnload();
	
	layui.cache.base = '/assets/tbynet/admin/'; //静态资源所在路径
	layui.config({
		version: true
  	}).extend({
  		'tbynet': '{/}/assets/tbynet/tbynet'
  	}).use('tbynet', function(){
    	var $ = layui.$
    	,form = layui.form
    	,tbynet = layui.tbynet;
    	
    	//刷新图形验证码
    	$('body').on('click', '.captcha', function(){
    		$(this).find('img').attr('src', '/admin/captcha?t='+ new Date().getTime());
    	});
		
    	//表单提交返回成功后才执行这个方法
    	tbynet.form['/admin/forget'] = function(data, required, res){
    		
    		//登录成功的提示与跳转
  			layer.msg('发送成功', {
    			offset: '15px'
    			,icon: 1
    			,time: 1000
  			}, function(){
    			location.href = '/admin/login';
  			});
    	};  
  	});
  	</script>
</body>
</html>